<!--   添加房源   -->
<template>
    <div>
        <header>
            <el-breadcrumb separator="/">
                <el-breadcrumb-item :to="{ path: '/room' }">房源管理</el-breadcrumb-item>
                <el-breadcrumb-item>新增房源</el-breadcrumb-item>
            </el-breadcrumb>
        </header>
        <div class="main">
            <div class="room_top">
                <div class="room_left">
                    <!-- 添加编辑  房源信息     roomkeepievent为接收子组件数据事件          tjstatus为为子组件传值 -->
                    <Editroom  @keepevent="roomkeepievent" @followevent="roomfollowievent" @maininfoevent="roommaininfoievent" @housingevent="roomievent" backlist="0" maininfo="1"/>
                </div>
                <div class="room_right">
                    <!-- 客源 -->
                    <div class="title">可匹配的客源信息：</div>
                    <!-- 客源列表 -->
                    <el-table :data="customer.data" border style="width: 100%" size="mini">
                        <el-table-column align="center" prop="c_numbering" label="编号" width="100"></el-table-column>
                        <el-table-column align="center" prop="c_trading_type_name" label="交易类型" width="70"></el-table-column>
                        <el-table-column align="center" prop="c_buy_status_name" label="购买状态" width="70"></el-table-column>
                        <el-table-column align="center" prop="c_area_address" label="地址" width="120"></el-table-column>
                        <el-table-column align="center" prop="c_user_intention_name" label="意向" width="60"></el-table-column>
                        <el-table-column align="center" prop="c_entrust_time" label="委托时间" width="70"></el-table-column>
                        <el-table-column align="center" label="面积" width="100">
                            <template slot-scope="scope">
                                {{scope.row.c_acreage_min}}-{{scope.row.c_acreage_max}}
                            </template>
                        </el-table-column>
                        <el-table-column align="center" label="价格" width="100">
                            <template slot-scope="scope">
                                {{scope.row.c_price_min}}-{{scope.row.c_price_max}}
                            </template>
                        </el-table-column>
                        <el-table-column align="center" fixed="right" label="操作" width="90">
                            <template slot-scope="scope">
                                <el-button type="text" size="small" @click="lookresources(scope.row)">查看</el-button>
                            </template>
                        </el-table-column>
                    </el-table>
                </div>
            </div>
            <div class="room_bottom">
                <div class="room_bottom_left">
                    <!-- 房源信息  -->
                    <p class="room_tit">{{important_information.first}}</p>
                    <p class="txt">{{important_information.secound}}</p>
                    <p class="remarks">{{important_information.third}}</p>
                    <p class="">{{important_information.fouth}}</p>
                </div>
                <div class="operation">

                    <!-- 跟进列表 -->
                    <el-table :data="followlistdata.data" tooltip-effect="light" style="width: 100%" class="followtable" @row-dblclick="showfollowlist" :show-header="false">
                        <el-table-column align="center" :formatter="followFun" prop="f_content" label="跟进" show-overflow-tooltip></el-table-column>
                        <el-table-column align="center" prop="u_username" label="跟进人" width="120"></el-table-column>
                        <el-table-column align="center" prop="f_created_at" label="跟进时间" width="140"></el-table-column>
                    </el-table>

                    <!-- 分页 -->
                    <el-pagination small :current-page="followcurrent" @current-change="followCurrentChange" :total="followlistdata.total" style="margin-top:10px;" v-if="followlistdata.total"></el-pagination>
                     
                </div>
            </div>

            <!-- 编辑跟进 -->
            <el-dialog title="修改跟进" :visible.sync="editfollowdialogVisible" width="70%" center v-if="editfollowdialogVisible">
                <!-- followsearch: 跟进数据查询条件   parentid:房客源id    resourcesdata: 1为房源，2为客源   classdata：1为添加跟进，2为修改跟进   permissionFollowVal （公客）看客户不必写跟进 权限 0为要写，1为不用写-->
                <Editfollow :followsearch="followsearch" :parentid="0" :resourcesdata="1" :classdata="2" @followevent="followievent" :permissionFollow="1" />
            </el-dialog>

            <!-- 编辑客源信息 -->
            <el-dialog title="客源" :visible.sync="resourcesdialogVisible" v-if="resourcesdialogVisible" width="70%" center>
                <!-- backlist 判断是否有返回列表按钮，0为有，1为无        maininfo判断是否返回有底部房源主要信息  0为无 1为有 -->
                <Editresources backlist="1" maininfo="0"/>
            </el-dialog>
            
        </div>
    </div>
    
</template>
<style>
    .followtable td{
        font-size: 12px;
        padding: 2px 0px;
    }
</style>

<script src='../../../contral/add_room.js'></script>